package com.cll.dao_ru_demo.service.impl;

import com.cll.dao_ru_demo.mapper.TUserMapper;
import com.cll.dao_ru_demo.pojo.TUser;
import com.cll.dao_ru_demo.pojo.TUserExample;
import com.cll.dao_ru_demo.service.UserService;
import excel.ImportRspInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
@Service
public class UserServiceImpl implements UserService {
    @Autowired
    TUserMapper tUserMapper;
    @Override
    public int deleteByPrimaryKey(Integer uid) {
        return tUserMapper.deleteByPrimaryKey(uid);
    }

    @Override
    public int insert(TUser record) {
        return tUserMapper.insert(record);
    }

    @Override
    public TUser selectByPrimaryKey(Integer uid) {
        return tUserMapper.selectByPrimaryKey(uid);
    }

    @Override
    public int updateByPrimaryKey(TUser tUser) {
        return tUserMapper.updateByPrimaryKey(tUser);
    }

    @Override
    public List<TUser> selectByExample(TUserExample tUserExample) {
        return tUserMapper.selectByExample(tUserExample);
    }

    @Override
    public boolean addAll(ImportRspInfo<TUser> list) {
        List<TUser> data = list.getData();
        data.forEach(d->{
            tUserMapper.insert(d);
        });
        return true;
    }

    @Override
    public List<TUser> selectList() {
        return tUserMapper.selectList();
    }
}
